package com.lambda.demo.stream;

import com.lambda.demo.models.AuthorsData;

public class StreamSortedTest {
  public static void main(String[] args) {
    //作家年纪由小到大排列
    AuthorsData.getAuthors().stream()
      .sorted((a,b) -> a.getAge() - b.getAge())
      .forEach(a -> System.out.println(a.getName()));
  }
}
